/* $Id: central.h jjs $ */
/*
   Copyright (C) 2007 by Jurjen Stellingwerff <jurjen@stwerff.xs4all.nl>
   Part of the Moros Project http://moros.sourceforge.net/

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 2 or any
   later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY.

   See the COPYING file for more details.
*/

#ifndef __CENTRAL_H
#define __CENTRAL_H

/** \dir src/central
  * The moros central server.
  * Used to store user identification and different games to join.
  */

class central {
  private:
    time_t timestamp;
    long game_number;
    user *current_user;
    communicate comm;
    std::string game_dir;
    std::string config_file;
  public:
    central();
    time_t current_time;
    void config_handler(channel *ch);
    void save_all(std::string config_file);
    void tls_handler(channel *ch);
    void change_game(channel *ch);
    void client_handler(channel *ch);
    std::string rand_session();
    void do_fork(std::string file);
    void chat_session(std::string session);
    void config(); ///< Read the data from the config files
    void log_level(std::string level);
    void log_file(std::string logfile);
    void game_directory(std::string dir);
    void main_loop();
};

#endif // __CENTRAL_H
